<template>
  <div class="context">
    <!--搜索框-->
    <!-- <el-input style="width: 400px; margin: 20px 20px 20px 20px" v-model="inputValue" placeholder="请输入内容"
      prefix-icon="el-icon-search">
    </el-input>
    <el-button type="primary" @click="toSelect" style="height: 40px; margin: 0px 0px 0px 20px">
      立即查询</el-button> -->

    <template>
      <el-table :data="notes" style="width: 100%" height="90%">
        <el-table-column type="index" width="50" >
        </el-table-column>

        <el-table-column label="昵称">
          <template slot-scope="scope">
            <span>{{ scope.row.name }}</span>
          </template>
        </el-table-column>

        <el-table-column label="电话">
          <template slot-scope="scope">
            <span>{{ scope.row.phone }}</span>
          </template>
        </el-table-column>


        <el-table-column label="学历">
          <template slot-scope="scope">
            <span>{{ scope.row.degree }}</span>
          </template>
        </el-table-column>

        <el-table-column label="意向岗位">
          <template slot-scope="scope">
            <span>{{ scope.row.intension }}</span>
          </template>
        </el-table-column>


        <el-table-column label="期望薪资">
          <template slot-scope="scope">
            <span>{{ scope.row.salary }}</span>
          </template>
        </el-table-column>

        <el-table-column label="操作">

          <template slot-scope="scope">
            <el-button type="text" @click="looknote(scope.$index, scope.row)" size="small">查看</el-button>
            <el-button type="text" size="small">审核</el-button>
            <el-button type="text" size="small">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div class="block">

        <el-pagination 
      @current-change="handleCurrentChange"
  background
  layout="prev, pager, next"
  :total="1000">
</el-pagination>

      </div>
    </template>
  </div>
</template>

<script>
export default {
  data() {
    return {
      pagecount: 99,//查询的总数
      currentPage4:4,
      notes: [],//简历数据数组
      req: {
        "pageIndex": 0,
        "pageCount": 10
      }
    };
  },
  
  created() {
    var that = this;
    console.log("Vue 初始化完成 created");
    this.pushdata();
  },
  methods: {
    next(a){
      console.log(a);
    },
    reset() {
    this.req = {
      "pageIndex": 0,//每次请求数据的开始位置
      "pageCount": 10//每次请求数据的总量
    }
    },

    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);

      if (val != 1) {
        var statcount = (val - 1) * this.req.pageCount
        this.req.pageIndex = statcount
        console.log("当前开始index--" + statcount);
      } else {
        this.req.pageIndex = 0
        console.log("当前开始index--" + statcount);
      }

      console.log(this.req);
      this.pushdata()
    },
    looknote(index, row) { 
      // console.log(row);
      // this.$router.push("/detailnotes");
      let routeUrl = this.$router.resolve({
     path: "/detailnotes",
     query:row
   });
     //let routeUrl = this.$router.resolve(`/share/${96}`)
   window.open(routeUrl.href, '_blank');
    },//查看简历
    pushdata() {
      var that = this;
     

      this.$axios.post("/api/Notes/FindNote", {
        "pageIndex": that.req.pageIndex,
        "pageCount":  that.req.pageCount,
      })
        .then(function (response) {

          console.log(response.data);
          if (response.data.code == 200) {
            that.notes = response.data.data
          } else {
            that.$message.error(response.data.mes);
          }
        })
        .catch(function (error) {
          that.$message.error('网络链接超时！');
          console.log(error);
        });
    }
  }
};
</script>

<style scoped>
.context {
  position: relative;
  width: 1300px;
  height: 600px;
  margin: 20px auto;
  background-color: rgb(255 255 255);
  -webkit-box-shadow: 3px 3px 6px rgb(196, 189, 189);
  -moz-box-shadow: 3px 3px 6px rgb(196, 189, 189);
  box-shadow: 3px 3px 6px rgb(196, 189, 189);
}
</style>
